'''
Author: GlenZhao
Date: 2025-05-07 10:51:47
LastEditors: GlenZhao
LastEditTime: 2025-05-08 12:40:20
Description: 
'''
# -*- coding: utf-8 -*-
# @version : 1.0
# @File    : user.py
# @Date    : 2024/9/28 14:26
# @Author  : GlenZhao
# @Desc    :
from fastapi import Depends, Query
from core.dependencies import Paging, QueryParams


class UserParams(QueryParams):
    """
    列表分页
    """

    def __init__(
            self,
            ids: str = Query(None, description="用户ids"),
            name: str = Query(None, description="用户昵称"),
            telephone: str = Query(None, description="手机号"),
            email: str = Query(None, description="邮箱"),
            params: Paging = Depends()
    ):
        super().__init__(params)
        self.id = ("in", ids.split(","))
        self.name = ("like", name)
        self.telephone = telephone
        self.email = email


class UserAuthParams(QueryParams):
    def __init__(
            self,
            token: str = Query(..., description="用户token"),
    ):
        super().__init__()
        self.token = token  